Fix root build order and add workspace typecheck to CI - #29
Conversation
The root build and typecheck scripts ran tsc -b before @onkernel/cua-agent's tsdown build, so packages/cli was type-checked against a missing (fresh clone) or stale (previously built checkout) dist/index.d.ts. Reorder the scripts so workspace dist artifacts exist before tsc -b runs, and add a typecheck step to the cli-unit CI job, which previously never type-checked packages/cli (vitest does not type-check). Also prune orphaned @mariozechner/* 0.67 entries and their unreferenced transitive deps from package-lock.json (leftover from the pi 0.79 migration).
|
Created a monitoring plan for this PR. What this PR does: Fixes the root workspace build and typecheck scripts so they compile dependencies in the correct order, and closes a type-checking gap in CI by adding a Intended effect: No production telemetry signal exists for this change. The measurable outcome is purely within CI: the Risks:
Status updates will be posted automatically on this PR as monitoring progresses. |
Summary
npm ci && npm run buildon a fresh clone of main fails, and on a previously built checkout it fails differently. Root cause: the rootbuildandtypecheckscripts runtsc -bbefore@onkernel/cua-agent's tsdown build, sopackages/cliis type-checked againstpackages/agent/distthat either doesn't exist yet (fresh clone →TS2307cascade) or is stale from an older pi-agent-core build (→ phantom errors like missinggetModel/model_update, even though pi-agent-core 0.79.1 has those APIs and the cli code is correct).CI never caught this because no job runs the root build or type-checks
packages/cli—cli-unitonly runs vitest, which transpiles without type-checking.buildandtypecheckso thecua-aiandcua-agentdist artifacts are built beforetsc -b.npx tsc -bstep to thecli-unitjob (after the ai/agent builds), closing the type-check gap for the whole workspace.@mariozechner/*@0.67lockfile entries and their unreferenced transitive deps (411 deleted lines, no version changes) — leftovers from the pi 0.79 migration.Test plan
tsc -b --clean, alldist/removed,npm ci):npm run buildpasses end to end, including the ptywright native build with zig 0.15.2npx tsc -bexits 0PTYWRIGHT_REQUIRED=1 npm test --workspace @onkernel/cua-cli— 33/33npm test --workspace @onkernel/cua-ai— 88/88;npm test --workspace @onkernel/cua-agent(excl. live) — 28/28cli-unit)🤖 Generated with Claude Code
Note
Low Risk
Script ordering and CI guardrails plus lockfile pruning; no runtime behavior or API changes.
Overview
Fixes fresh and stale clone build failures by building
@onkernel/cua-aiand@onkernel/cua-agentbefore roottsc -b, sopackages/clitype-checks against currentpackages/agent/distinstead of missing or outdated artifacts.Root
buildandtypecheckscripts now follow that order. Thecli-unitCI job adds an explicitnpx tsc -bstep after the ai/agent workspace builds (before ptywright native build and vitest), so the monorepo project references are enforced in CI—not only via tests that transpile without full type-checking.package-lock.jsondrops orphaned@mariozechner/*@0.67trees and unreferenced transitive deps left from the pi 0.79 migration (lockfile cleanup only, no intentional version bumps).Reviewed by Cursor Bugbot for commit a52c9d3. Bugbot is set up for automated code reviews on this repo. Configure here.